//*****************************************************************************
//
// Copyright, (C) 2000-2005 Quantic Dream SA
//
// These coded instructions, statements and computer programs contain
// unpublished information, proprietary to Quantic Dream SA and are 
// protected by French and EEC copyright laws. They may not be 
// disclosed to third parties or copied or duplicated, in whole or in part, 
// without prior written consent of Quantic Dream SA
//
// Unpublished-rights reserved under the Copyright Laws of the EEC.
//
//*****************************************************************************
//
//	CLASS:	KERNEL_DEFINES
//	The KERNEL_DEFINES class implements ...
//
//	JJA : 2012-07-23 - Created
//*****************************************************************************

//=============================================================================
//	CODE STARTS HERE
//=============================================================================

#ifndef KERNEL_DEFINES_H
#define KERNEL_DEFINES_H

#define NULL 0

#define	DECLARE_ALIGNED( AlignmentSize )					__declspec( align( AlignmentSize ) )
#define	ALLOC_ALIGNED( size, AlignmentSize )				_aligned_malloc( size, AlignmentSize )
#define	TYPED_ALLOC_ALIGNED( Type, size, AlignmentSize )	(Type*)_aligned_malloc( size * sizeof(Type), AlignmentSize )

#define	ALIGNED_NEW_DELETE( AlignmentSize )			\
													\
void *operator new(size_t size) throw()				\
{													\
	return _aligned_malloc(size, AlignmentSize);	\
}													\
													\
void operator delete(void *ptr) throw()				\
{													\
	_aligned_free(ptr);								\
}

#endif // KERNEL_DEFINES_H

//=============================================================================
//	CODE ENDS HERE
//=============================================================================